const user=require("../model/user");

module.exports=function(req,res){
    if(req.session.ifLogin){
        user.findOne({_id:req.session.user._id}).then(result=>{
            res.render("usercenter",{
                user:result
            });
        })
    }else{
        res.redirect("/");
    }
    
}